import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../components/Login.vue'
// 导入后台文件
import Home from '../components/Home.vue'
// 后台欢迎页面
import Welcome from '../components/Welcome.vue'
// 后台Home
import Users from '../components/1 home/Users.vue'
// 2.后台运营数据模块
import S21 from '../components/2 yunyingshuju/2-1.vue'
import J22 from '../components/2 yunyingshuju/2-2.vue'
// 4.后台商品模块
import S42 from '../components/4 shangpinqingkuang/4-2.vue'
// 5.后台会员情况
import H51 from '../components/5 huiyuanguanli/5-1.vue'
import H52 from '../components/5 huiyuanguanli/5-2.vue'
// 导入sigin注册登录
import B71 from '../components/6 bangzhu/index.vue'

Vue.use(VueRouter)

const routes = [
  { path: '/', redirect: 'login' },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/home',
    component: Home,
    redirect: '/welcome',
    children: [
      { path: '/welcome', component: Welcome },
      { path: '/hemo', component: Users },
      // 后台运营数据模块
      { path: '/S2-1', component: S21 },
      { path: '/J2-2', component: J22 },
      // 后台商品模块
      { path: '/S4-2', component: S42 },
      // 后台会员用户
      { path: '/H5-1', component: H51 },
      { path: '/H5-2', component: H52 },
      // 帮助
      { path: '/B7', component: B71 }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  routes
})

export default router
